﻿using System;
using System.Reflection;

namespace VersionsAtributes
{
    class VersionsTest
    {
        [VersionsAtribute("pesho")]
        public void StupidStuf() 
        {
            Console.WriteLine("pesho");
        }

        [VersionsAtribute("gosho","skubane")]
        public void MoreShittyStuf() 
        {
            Console.WriteLine("gosho");
        }

        static void Main(string[] args)
        {
            Type type = typeof(VersionsTest);
            MethodInfo[] information = type.GetMethods();

            foreach (var info in information) 
            {
                
                object[] methodAttributes = info.GetCustomAttributes(false);
                foreach (dynamic atribute in methodAttributes) 
                {
                    if (atribute.GetType() == typeof(VersionsAtribute))
                    {
                        Console.WriteLine("{0} {1}", atribute.Name, atribute.Comment);
                    }
                }
                
            }
        }
    }
}
